﻿using System.Globalization;
using System.Web;
using System.Web.SessionState;

namespace SBPweb.RIA.Server.Common.Web
{

    ///// <summary>
    ///// Summary description for CultureManager
    ///// </summary>
    //public class CultureManager
    //{
    //    private static HttpSessionState pSession
    //    {
    //        get
    //        {
    //            return HttpContext.Current.Session;
    //        }
    //    }

    //    public static CultureInfo DefaultCulture
    //    {
    //        get
    //        {
    //            if (CookieHandler.DefaultCulture != null)
    //            {
    //                return CultureInfo.GetCultureInfo(CookieHandler.DefaultCulture);
    //            }
    //            return ConfigurationHandler.AvailableCultures[0] as CultureInfo;
    //        }
    //    }

    //    public static CultureInfo[] AvailableCultures
    //    {
    //        get
    //        {
    //            return ConfigurationHandler.AvailableCultures;
    //        }
    //    }

    //    private const string KEY_SelectedCulture = "SelectedCulture";
    //    public static CultureInfo SelectedCulture
    //    {
    //        get
    //        {
    //            if (SessionHandler.Get<CultureInfo>(KEY_SelectedCulture) == null)
    //            {
    //                SessionHandler.Put<CultureInfo>(KEY_SelectedCulture, DefaultCulture);
    //            }
    //            return SessionHandler.Get<CultureInfo>(KEY_SelectedCulture);
    //        }
    //    }

    //    public static void SetSelectedCulture(string name)
    //    {
    //        SessionHandler.Put<CultureInfo>(KEY_SelectedCulture, CultureInfo.GetCultureInfo(name));
    //        CookieHandler.DefaultCulture = name;
    //    }

    //    public static void MaintainCulture()
    //    {
    //        System.Threading.Thread.CurrentThread.CurrentCulture = SelectedCulture;
    //        System.Threading.Thread.CurrentThread.CurrentUICulture = SelectedCulture;
    //    }
    //}
	
}